Skip to content

INTPYTHON-599 Make a field's custom lookups and transforms available in embedded model queries #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 29, 2025

Conversation

timgraham
Copy link
Collaborator

@timgraham timgraham commented Apr 22, 2025

No description provided.

@timgraham timgraham changed the title INTPYTHON-599 Fix ArrayFied lookups in embedded models INTPYTHON-599 Make a field's custom lookups available in embedded model queries Apr 22, 2025
@timgraham timgraham changed the title INTPYTHON-599 Make a field's custom lookups available in embedded model queries INTPYTHON-599 Make a field's custom lookups and transforms available in embedded model queries Apr 26, 2025
@timgraham timgraham requested a review from WaVEV April 27, 2025 00:13
if isinstance(self.ref_field, EmbeddedModelField):
opts = self.ref_field.embedded_model._meta
new_field = opts.get_field(name)
result = KeyTransformFactory(name, new_field)
return KeyTransformFactory(name, new_field)
if transform := self.ref_field.get_transform(name):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outstanding change!! It simplifies a lot of things.

Copy link
Collaborator

@WaVEV WaVEV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just apply this changes.
The json handled is not longer needed in EMF resolver.
requested_changes.patch

@timgraham timgraham marked this pull request as ready for review April 29, 2025 01:01
@timgraham timgraham merged commit 782feb7 into mongodb:main Apr 29, 2025
14 checks passed
@timgraham timgraham deleted the PY599 branch April 29, 2025 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants